<!doctype html>
<html>
<head>
</head>
<body>
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
?>

<!-- JavaScript -->
<script type="text/javascript" src="<?php echo base_url() ?>js/wufoo.js"></script>
<script type="text/javascript" src="<?php echo base_url() ?>js/zebra_datepicker.js"></script>

<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>css/form/form.css" media="screen, tv, projection" title="Default" />
<link rel="stylesheet" href="<?php echo base_url() ?>css/zebra_datepicker_metallic.css" type="text/css">
<link rel="stylesheet" type="text/css" href="<?= base_url() ?>css/chosen.css" media="screen, tv, projection" title="Default" />


<div id="container">
	<?php
    //Setting Awal Value Jika Prosedur yang dilakukan adalah prosedur input biasa.
    	$value['legend'] = "Form Edit Kategori";
		$value['info'] = "Form edit data kategori dan jenis";
		$value['act_form'] = "kategori/edit_kategori/".$ktg."/".$jenis;
	
	?>
	<?php echo form_open_multipart($value["act_form"],'class="wufoo" name="form_edit_kategori"'); ?>
	<fieldset class="fieldset">
	<legend class="legend">
		<?= $value["legend"] ?> |
	</legend>
	
	<div>
		<?php echo anchor(site_url('kategori'),img(array('src'=>'images/main/ic_back.png','border'=>'0','alt'=>'','width'=>'20px','height'=>'20px','margin-right'=>'10px')).'Kembali ke daftar kategori','Menampilkan halaman Daftar Kategori'); ?>
	</div>
	
	<div class="separator">
	</div>
	
 <!-- Konten -------------------------------------------------------------------------->
 <div id="contentform">
 <?php $atrib='style="width:250px"; class="chzn-select field"'?>
 <?php $atrib_jenis='style="width:250px;" id="jenis" class="chzn-select field"'?>
 <table border="0" width="100%" cellpadding="0" cellspacing="0">
 <tr valign="top">
 <td style="padding:10px;width:40%;">
	<ul>            
				
				<li>
                    <label class="desc">Kategori *</label>
                        <div>
                             <?php 
							 echo form_dropdown('kategori', $jenis_options, $ktg ,$atrib_jenis); ?>
                        </div>
                    <p class="instruct">
                            Pilih Kategori
                    </p>
                </li>
                <?php echo form_error('kategori'); ?>
	
				<li>
                    <label class="desc">Jenis *</label>
                        <div>
                             <input type="text" name="jenis" class="new field" value="<?php echo $jenis;?>"
                        </div>
                    <p class="instruct">
                            Deskripsi jenis
                    </p>
                </li>
                <?php echo form_error('jenis'); ?>
				

        		<li class="buttons">
                  <input id="submit" type="submit" value="Simpan" />
                  <input id="reset" type="reset" value="Reset" />
                </li>
	</ul>
	</td>
	</tr>
	</table>
</div>
</fieldset>
<?= form_close(); ?>

<script type="text/javascript" src="<?= base_url() ?>js/chosen.jquery.js"></script>
	<script type="text/javascript">
			$(".chzn-select").chosen({no_results_text: "Data yang dicari tidak ditemukan"});
		</script>
<script type="text/javascript">
$("#jenis").bind('change',function () 
{	
var prp = $("#jenis").val();

	$.ajax({
			url: "<?php echo base_url();?>index.php/helpdesk/kategori/get_ajax_sub_jenis/",
			global: false,
			type: "POST",
			async: false,
			dataType: "html",
			data: "jenis="+ prp, //the name of the $_POST variable and its value
			success: function (response) {
				 var bahan = response;
				 
				 //document.getElementById('info_jd').innerHTML = pecah[0];
				 document.getElementById('sub_jenis').innerHTML = response;
				 }
	});
	$("#sub_jenis").trigger("liszt:updated");
	
	return false;
}
);

 $(document).ready(function() {

    $('input.calendar').Zebra_DatePicker(
	{
	format:'d/m/Y'
	});

 });
</script>

</div><!--container-->
</body>
</html>